package com.wnxy.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wnxy.entity.China;
import com.wnxy.service.ChinaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author woniumrwang
 * @since 2023-03-07 02:24:52
 */
@RestController
@RequestMapping("/china")
public class ChinaController {

    @Autowired
    ChinaService chinaService;

    @RequestMapping("getAddress")
    public List<China> listByPid(Integer provinceId){

        QueryWrapper<China> chinaQueryWrapper = new QueryWrapper<>();
        chinaQueryWrapper.eq("Pid",provinceId);
        List<China> chinaList = chinaService.list(chinaQueryWrapper);

        return chinaList;
    }


}

